<template>
	<view>
        <view @click="selectPlate" class="box">
        	<view class="data-plate">
        		<view  class="data-tits">{{plTitle.length<1?'省':plTitle[0]}}</view>
        			<view class="data-titt">{{plTitle[1]}}</view> 
        	</view>
          <view class="plate-num">{{plTitle[2]}}</view>
        		<view class="plate-num">{{plTitle[3]}}</view>
        		<view class="plate-num">{{plTitle[4]}}</view>
        		<view class="plate-num">{{plTitle[5]}}</view>
        		<view class="plate-num">{{plTitle[6]}}</view>
          <view class="">
        		   <view v-if="plTitle.length <8" class="plate-nums">
        		   	<view>+</view>
        		   	<text>新能源</text>
        		   </view>
        		   <view  v-else class="plate-num">
        		   	  {{plTitle[7]}}
        		   </view>
        		</view>
        		  <u-keyboard :mask="false" ref="uKeyboard" @change="valChange" @backspace="backspace" mode="car" v-model="show"></u-keyboard>
        </view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				show:false,
				plTitle:'',
			}
		},
		methods:{
			selectPlate(){
				this.show = true
			},
			valChange(e){
				if(this.plTitle.length>=8){
					return
				}
				if(this.plTitle.length <1){
					this.plTitle = ''
				}
				this.plTitle += e
				console.log(this.plTitle)
				this.$emit('getReceive',this.plTitle)
			},
			backspace(){
				if(this.plTitle.length) this.plTitle = this.plTitle.substr(0, this.plTitle.length - 1);
			    this.$emit('getReceive',this.plTitle)
			}
		}
	}
</script>

<style lang="scss">
.data-top{
	  width: 100%;
	  height: 175rpx;
	  background: #F1F5F8;
	  padding-top: 35rpx;
  }
  .data-tit{
	  width: 700rpx;
	  height: 40rpx;
	  font-size: 35rpx;
	  font-weight: bold;
	  line-height: 40rpx;
	  margin:  40rpx auto;
	  display: flex;
	 
	  justify-content: space-between;
	  align-items: center;
  }
  .box{
	  width: 100%;
	  height: 100rpx;
	  padding: 0 40rpx;
	  display: flex;
	  align-items: center;
	  .plate-num{
		  width: 76rpx;
		  height: 95rpx;
		  border: 1px solid #C0C0C0;
		  border-radius: 10rpx;
		  margin-right: 10rpx;
		  display: flex;
		  align-items: center;
		  justify-content: center;
		  font-size: 32rpx;
		  font-weight: bold;
	  }
	  .plate-nums{
		  width: 76rpx;
		  height: 95rpx;
		  border: 1px solid #5B97CC;
		  border-radius: 10rpx;
		  display: flex;
		   flex-direction: column;
		  align-items: center;
		  justify-content: center;
		  color: #5B97CC;
		  font-size: 18rpx;
	  }
	.data-plate{
		  width: 160rpx;
		  height: 95rpx;
		  border: 1px solid #5B97CC;
		  border-radius: 10rpx;
		  display: flex;
		  align-items: center;
		  margin-right: 30rpx;
		  .data-tits{
			  // flex: 1;
			  width: 50%;
			  height: 80%;
			  border-right:1px solid #C0C0C0;
			  display: flex;
			  align-items: center;
			  justify-content: center;
			  font-size: 32rpx;
			  font-weight: bold;
		  }
		  .data-titt{
			  width: 50%;
			  height: 80%;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 32rpx;
			font-weight: bold;
		  }
	}
  }
</style>
